import Vue from 'vue'
import App from './App.vue'
import router from './router'
import axios from 'axios'
// import VueAxios from 'vue-axios'
import './plugins/element.js'
// 导入全局样式表
import './assets/css/global.css'

// 导入字体图标
import './assets/fonts/iconfont.css'

// 导入全局URL
import URL from './config/url.js'

import store from './store'

// import ECharts from 'vue-echarts'
// Vue.component('v-chart', ECharts)

// Vue.use(VueAxios, axios)
Vue.config.productionTip = false
// 通过axios拦截器添加token验证
axios.interceptors.request.use(config => {
    console.log(config);
    config.headers.Authorization = window.localStorage.getItem('admin_token');
    // 在最后必须return config
    return config;
})

// 注册为全局URL
Vue.prototype.URL = URL
Vue.prototype.$http = axios

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')